% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_map_headernames.R
\docType{data}
\name{map_headernames}
\alias{map_headernames}
\title{map_headernames provides metadata about all indicators in EJAM/EJScreen}
\format{
An object of class \code{data.frame} with 635 rows and 76 columns.
}
\usage{
map_headernames
}
\description{
map_headernames provides metadata about all indicators in EJAM/EJScreen
}
\details{
This is an IMPORTANT TABLE that provides information about each variable (indicator), such as the following:
\itemize{
\item names as used in geodatabase files (original data source)
\item names as used in the outputs of the EJScreen API
\item names as used in the R code
\item names as used in short labels of graphics
\item names as used in table headers (long versions to provide full descriptions of the variables)
\item category of variable, for purposes of grouping similar ones like those in names_d or names_d_pctile
\item info about rounding decimal places, significant digits, percentage format, etc.
\item method for aggregating the value across blockgroups (sum, weighted mean, what is the weight, etc.)
\item etc.
}

It was created from a spreadsheet of the same name, that is in a data-raw folder. Several helper functions are used to query it such as \code{\link[=fixcolnames]{fixcolnames()}} and many functions rely on it. You can see examples of what it contains like this, for example:

\code{data.frame(t(map_headernames[1:2, ]))}
}
\examples{
  #   See how many variables are on each list, for example: 
  \dontrun{
  data.table::setDT(copy(map_headernames))[, .(
    variables = .N, 
    has_apiname = sum(apiname != ""), 
    has_csvname = sum(csvname != ""), 
    has_acsname = sum(acsname != "")
    ), 
 keyby = c("raw_pctile_avg", "DEJ", "ratio.to", "pctile.", "avg.",  "varlist" )]
  
 # Which sources provide which key variables or indicators? 
 
 some <- unique(map_headernames$rname[map_headernames$varlist != "" 
   & map_headernames$varlist != "x_anyother"])
 
 info <- cbind(
   varinfo(some, info = c('api', 'csv', 'acs', 'varlist')), 
   usastats = some \%in\% names(usastats), 
   statestats = some \%in\% names(statestats))
 info <- info[nchar(paste0(info$api, info$csv, info$acs)) > 0, ]
 info
 
 # any others
 
 some <- unique(map_headernames$rname[map_headernames$varlist != "" 
   & map_headernames$varlist == "x_anyother"])
 
 info <- cbind(
   varinfo(some, info = c('api', 'csv', 'acs', 'varlist')), 
   usastats = some \%in\% names(usastats), 
   statestats = some \%in\% names(statestats))
 info <- info[nchar(paste0(info$api, info$csv, info$acs)) > 0, ]
 info
  }
 
}
\seealso{
\code{\link[=varinfo]{varinfo()}} \code{\link[=fixcolnames]{fixcolnames()}} \code{\link[=varin_map_headernames]{varin_map_headernames()}} \code{\link[=varlist2names]{varlist2names()}}
}
\keyword{datasets}
